public class StringLength {
  public static void main(String[] args) {
    String greeting = "你好";
    System.out.println("The length of \"" + greeting + "\" is : " + greeting.length());

    int cpCount = greeting.codePointCount(0, greeting.length());
    System.out.println("The true length of \"" + greeting + "\" is : " + cpCount);

    String test = "ℤ";
    cpCount = test.codePointCount(0, test.length());
    System.out.println("The length of \"" + test + "\" is : " + test.length());
    System.out.println("The true length of \"" + test + "\" is : " + cpCount);

    System.out.println(test.charAt(0));
  }
}
